package org.opensource.home.service;

import java.math.BigDecimal;
import java.util.LinkedList;
import java.util.List;

import org.opensource.home.model.Brand;
import org.opensource.home.model.Car;
import org.springframework.stereotype.Service;

@Service
public class CarService {
	private static List<Car> carList;
	
	static{
		Brand brand1 = new Brand((long)1, "Mercedes", "Germany");
		Brand brand2 = new Brand((long)2, "Peugeot", "France");
		
		Car car1 = new Car((long)1, "SL 500", new BigDecimal(40000), brand1);
		Car car2 = new Car((long)2, "607", new BigDecimal(3000), brand2);
		
		carList = new LinkedList<Car>(); 
		carList.add(car1);
		carList.add(car2);
	}
	
	public List<Car> getCarList() {
		return carList;
	}
}
